package com.yj;

import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.quartz.QuartzJobBean;

@DisallowConcurrentExecution//禁用并发，在相同Quartz Scheduler集群中，相同JobKey（name+group）的JobDetail，有且仅有一个节点在执行
public class DemoJob2 extends QuartzJobBean {
    private Logger logger = LoggerFactory.getLogger(getClass());
    @Override
    protected void executeInternal(JobExecutionContext context) {
        logger.info("[DemoJob2][执行了]");
    }
}
